package com.netdimensions.confluence.plugins;

import com.atlassian.confluence.pages.PageManager;
import com.atlassian.confluence.spaces.SpaceManager;
import com.atlassian.confluence.user.AuthenticatedUserThreadLocal;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

import java.util.Arrays;
import java.util.Map;

public final class ModuleMacro extends EkpMacro {
    public ModuleMacro() {
    }

    protected final String html(final Element root) {
        return "Module goes here.";
    }

    protected final String url(final Map params) {
        final Object id = params.get("id");
        return UrlUtils.url("module", id == null ? Arrays.asList(new Parameter("userId", AuthenticatedUserThreadLocal.getUser().getName())) : Arrays.asList(new Parameter("id", id.toString()), new Parameter("userId", AuthenticatedUserThreadLocal.getUser().getName())));
    }
}